__author__ = 'vavava'


if __name__ == '__main__':
    """ for file debug"""
    import sys,os
    sys.path.insert(0,os.path.join( os.getcwd(), '..' ))

import sys,os
import vavava.util

if __name__ == '__main__':

    argv_dic=vavava.util.parse_argvs(sys.argv)

    src_path="."
    desc_path="./out"

    if argv_dic:
        if argv_dic.get('-s'):  src_path=argv_dic.get('-s')
        if argv_dic.get('-d'):  desc_path=argv_dic.get('-d')
        if argv_dic.get('-c'):  compress=argv_dic.get('-c')

    files = os.listdir(src_path)
    abs_src_path=os.path.abspath(src_path)
    abs_desc_path = os.path.abspath(desc_path)

    for each in files:
        if each.find(".ciz") == -1:
            descFileFullName=os.path.join(abs_desc_path,each.title()+".ciz")
            srcFileFullName=os.path.join(abs_src_path,each)

            if os.path.isfile(srcFileFullName):
                cmd = "ciz.exe -f -fl %s %s"%(descFileFullName,srcFileFullName)
                print(cmd)
                os.execvp( cmd, ("") ) #"ciz.exe", "-fl", descFileFullName, srcFileFullName )
                print("ok")


